<template>
  <div class="msgbox">
    <div>
      <button @click="isShow = !isShow">显示/隐藏</button>
    </div>
    <transition
      appear
      enter-active-class=" animate__animated animate__backInLeft"
      leave-active-class="animate__animated animate__backOutRight"
    >
      <span v-show="isShow" class="msg">我是消息组件3</span>
    </transition>
  </div>
</template>

<script>
import "animate.css";

export default {
  data() {
    return {
      isShow: true,
    };
  },
};
</script>

<style lang="less" scoped>
.msgbox {
  text-align: center;
}
.msg {
  display: block;
  margin-top: 50px;
  padding: 20px 0;
  background-color: pink;
}
</style>
